package src;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Date;

public class Logger {

	private static Logger logger;

	private Logger() {
	}

	public static Logger getLogger() {
		if (logger == null) {
			logger = new Logger();
		}
		return logger;
	}

	public void write(String className, String row) {
		try {
			FileOutputStream logFile = new FileOutputStream("log.txt",true);
			PrintStream scrivi = new PrintStream(logFile);
			String printedrow = className +": "+new Date().getTime()+" - "+row+"\r\n";
			scrivi.append(printedrow);
			scrivi.close();
		} catch (IOException e) {
		}
	}

}
